package com.qf.pojo;

import java.util.List;

/**
 * @author Mr.Liu
 * @date 2021/11/20 17:39
 * 分页查询用户组件
 */

public class PageBean<T>{
    private int currentPage;//当前页码
    private int totalPage;//总页码
    private int pageSize;//每页显示的条数
    private int totalSize;//总条数
    List<T> list;//分页查询的user集合

    public PageBean() { }

    public PageBean(int currentPage, int pageSize, int totalSize, List<T> list) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalSize = totalSize;
        this.list = list;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalPage() {
        return (totalSize/pageSize==0?totalSize/pageSize:(totalSize/pageSize+1));
    }


    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(int totalSize) {
        this.totalSize = totalSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "currentPage=" + currentPage +
                ", totalPage=" + totalPage +
                ", pageSize=" + pageSize +
                ", totalSize=" + totalSize +
                ", list=" + list +
                '}';
    }
}
